<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>学生列表</title>
<style type="text/css">
	.list{
		width:500px;
		margin: 0px auto;
		text-align: center;
	}
	.list table{
		width:500px;
		border: 1px solid #D1D1D1;
	}
	.list table td,.list table th{
		border-bottom: 1px solid #D1D1D1; 
		border-left: 1px solid #D1D1D1; 
	}
	.list table tr:LAST-CHILD td {
		border-bottom: 0px; 
	}
	.list table tr td:FIRST-CHILD,.list table tr th:FIRST-CHILD {
		border-left: 0px;
	}
</style>
</head>
<body>
	<div class="list">
		<h3>学生列表</h3>
		<table>
			<tr>
				<th>编号</th>
				<th>姓名</th>
				<th>年龄</th>
				<th>成绩</th>
				<th>学校</th>
				<th>删除</th>
			</tr>
			<c:forEach items="${list }" var="stu" varStatus="status">
				<tr>
					<td>${status.index+1}</td>
					<td><a href="stu_id?student.id=${stu.id }&page.currentPage=${ page.currentPage}&page.size=${page.size }">${stu.name }</a></td>
					<td>${stu.age }</td>
					<td>${stu.result }</td>
					<td><a href="sch_id?school.id=${stu.school.id }&page.currentPage=${ page.currentPage}&page.size=${page.size }">${stu.school.name }</a></td>
					<td><a href="stu_delete?student.id=${stu.id }&page.currentPage=${ page.currentPage}&page.size=${page.size }">删除</a></td>
				</tr>
			</c:forEach>
		</table>
		<div class="page">
			<a href="stu_list?page.currentPage=1&page.size=${page.size }">首页</a>
			<a href="stu_list?page.currentPage=${ page.currentPage-1}&page.size=${page.size }">上一页</a>
			<a href="stu_list?page.currentPage=${ page.currentPage+1}&page.size=${page.size }">下一页</a>
			<a href="stu_list?page.currentPage=${ page.countSize}&page.size=${page.size }">末页</a>
			跳转<input id="currentPage" type="text" name="currentPage" style="width: 20px;"  onblur="numBlur(this)" onfocus="numFocus(this)"/><input
					type="button" value="跳转" onclick="goUrl()" /> <br />当前页${page.currentPage }/总页数${page.countPage }
				每页记录${page.size }/总记录${page.countSize-1 }
				<script type="text/javascript">
					function goUrl() {
						var cur = document.getElementById("currentPage").value;
						if (cur != null && cur.trim() != "") {
							var size = ${page.size};
							location.href = "stu_list?page.currentPage="
									+ cur + "&page.size=" + size;
						}

					}
				</script>
		</div>
		<a href="sch_list">学校列表</a>
		<a href="stu_to_add?page.currentPage=1&page.size=999">添加学生</a>
	</div>
</body>
</html>